from base import Base
from  selenium.webdriver.common.by import By
from time import sleep


class XuXiPage(Base):
    qianggongtong = (By.XPATH,'//android.widget.FrameLayout[@content-desc="强国通[6]"]/android.widget.RelativeLayout/android.widget.RelativeLayout')
    sousk = (By.ID,'android:id/search_src_text')
    shousk = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout[1]/android.widget.RelativeLayout/android.widget.SearchView/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.EditText')
    duanyan = ' new UiSelector().resource-id("cn.xuexi.android:id/tv_empty_hint")'

    def souskyw(self,ne):
        self.find_ele(self.qianggongtong).click()
        sleep(2)
        self.find_wait_ele(self.sousk).click()
        sleep(2)
        self.find_wait_ele(self.shousk).send_keys(ne)
        sleep(3)